package com.example.multinetty.netty.firstprotocal;

import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;

public class SelfResponse {
    private HttpHeaders header;

    private FullHttpResponse response;

    private byte [] body;

    public SelfResponse(FullHttpResponse response)
    {
        this.header = response.headers();
        this.response = response;
        if (response.content() != null)
        {
            body = new byte[response.content().readableBytes()];
            response.content().getBytes(0, body);
            //response.content().writeBytes(body);
        }
    }
    public HttpHeaders header()
    {
        return header;
    }
    public byte [] body()
    {
        return body;
    }
}
